
// 此处对ajax 进行了二次封装  => 调用ajax请求,返回进行中状态的Promise实例
function requset(url, data = {}, type = "get") {
    return new Promise(function (resolve, reject) {
        $.ajax({
            type: type,
            url: url,
            data: { ...data },
            dataType: "json",
            success(obj) {
                resolve(obj);
            }
        });

    });
}

